﻿
#Const xhtml_1_1 = True
#Const strict = True

Imports System.IO

Public Class xhtmlControl
#If xhtml_1_1 Then
#If strict Then
    Inherits xhtmlControl_1_1_strict
#Else
    Inherits xhtmlControl_1_1_loose
#End If
#End If

    Public Sub New(Optional ByVal buff As Stream = Nothing, Optional ByVal tag As String = Nothing)
        MyBase.New(buff, tag)
    End Sub

    Public Class attributesCollection
        Protected Shared _core() As String = {"xml:space", "class", "id", "title"}
        Protected Shared _i18n() As String = {"dir", "xml:lang"}
        Protected Shared _events() As String = {"onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover" _
                                                , "onmousemove", "onmouseout", "onkeypress", "onkeydown", "onkeyup"}
        Protected Shared _style() As String = {"style"}
        Protected Shared _common() As Array = {_core, _i18n, _events, _style}

        Public Shared Function core(ByVal key As String) As Boolean
            Return Array.IndexOf(_core, key) <> npos
        End Function

        Public Shared Function i18n(ByVal key As String) As Boolean
            Return Array.IndexOf(_i18n, key) <> npos
        End Function

        Public Shared Function events(ByVal key As String) As Boolean
            Return Array.IndexOf(_events, key) <> npos
        End Function

        Public Shared Function style(ByVal key As String) As Boolean
            Return Array.IndexOf(_style, key) <> npos
        End Function

        Public Shared Function common(ByVal key As String) As Boolean
            Dim i As Int32
            For i = 0 To _common.Length() - 1
                If Array.IndexOf(_common(i), key) <> npos Then
                    Return True
                End If
            Next

            Return False
        End Function

        Public Shared Function xml_space(ByVal key As String) As Boolean
            Return strsame(key, "xml:space", False)
        End Function

        Public Shared Function [class](ByVal key As String) As Boolean
            Return strsame(key, "class", False)
        End Function

        Public Shared Function id(ByVal key As String) As Boolean
            Return strsame(key, "id", False)
        End Function

        Public Shared Function title(ByVal key As String) As Boolean
            Return strsame(key, "title", False)
        End Function

        Public Shared Function cite(ByVal key As String) As Boolean
            Return strsame(key, "cite", False)
        End Function

        Public Shared Function accesskey(ByVal key As String) As Boolean
            Return strsame(key, "accesskey", False)
        End Function

        Public Shared Function charset(ByVal key As String) As Boolean
            Return strsame(key, "charset", False)
        End Function

        Public Shared Function href(ByVal key As String) As Boolean
            Return strsame(key, "href", False)
        End Function

        Public Shared Function hreflang(ByVal key As String) As Boolean
            Return strsame(key, "hreflang", False)
        End Function

        Public Shared Function rel(ByVal key As String) As Boolean
            Return strsame(key, "rel", False)
        End Function

        Public Shared Function rev(ByVal key As String) As Boolean
            Return strsame(key, "rev", False)
        End Function

        Public Shared Function tabindex(ByVal key As String) As Boolean
            Return strsame(key, "tabindex", False)
        End Function

        Public Shared Function type(ByVal key As String) As Boolean
            Return strsame(key, "type", False)
        End Function

        Public Shared Function archive(ByVal key As String) As Boolean
            Return strsame(key, "archive", False)
        End Function

        Public Shared Function classid(ByVal key As String) As Boolean
            Return strsame(key, "classid", False)
        End Function

        Public Shared Function codebase(ByVal key As String) As Boolean
            Return strsame(key, "codebase", False)
        End Function

        Public Shared Function codetype(ByVal key As String) As Boolean
            Return strsame(key, "codetype", False)
        End Function

        Public Shared Function data(ByVal key As String) As Boolean
            Return strsame(key, "data", False)
        End Function

        Public Shared Function [declare](ByVal key As String) As Boolean
            Return strsame(key, "declare", False)
        End Function

        Public Shared Function height(ByVal key As String) As Boolean
            Return strsame(key, "height", False)
        End Function

        Public Shared Function name(ByVal key As String) As Boolean
            Return strsame(key, "name", False)
        End Function

        Public Shared Function standby(ByVal key As String) As Boolean
            Return strsame(key, "standby", False)
        End Function

        Public Shared Function width(ByVal key As String) As Boolean
            Return strsame(key, "width", False)
        End Function

        Public Shared Function value(ByVal key As String) As Boolean
            Return strsame(key, "value", False)
        End Function

        Public Shared Function valuetype(ByVal key As String) As Boolean
            Return strsame(key, "valuetype", False)
        End Function

        Public Shared Function datetime(ByVal key As String) As Boolean
            Return strsame(key, "datetime", False)
        End Function

        Public Shared Function accept(ByVal key As String) As Boolean
            Return strsame(key, "accept", False)
        End Function

        Public Shared Function accept_charset(ByVal key As String) As Boolean
            Return strsame(key, "accept-charset", False)
        End Function

        Public Shared Function action(ByVal key As String) As Boolean
            Return strsame(key, "action", False)
        End Function

        Public Shared Function method(ByVal key As String) As Boolean
            Return strsame(key, "method", False)
        End Function

        Public Shared Function enctype(ByVal key As String) As Boolean
            Return strsame(key, "enctype", False)
        End Function

        Public Shared Function alt(ByVal key As String) As Boolean
            Return strsame(key, "alt", False)
        End Function

        Public Shared Function checked(ByVal key As String) As Boolean
            Return strsame(key, "checked", False)
        End Function

        Public Shared Function disabled(ByVal key As String) As Boolean
            Return strsame(key, "disabled", False)
        End Function

        Public Shared Function maxlength(ByVal key As String) As Boolean
            Return strsame(key, "maxlength", False)
        End Function

        Public Shared Function [readonly](ByVal key As String) As Boolean
            Return strsame(key, "readonly", False)
        End Function

        Public Shared Function size(ByVal key As String) As Boolean
            Return strsame(key, "size", False)
        End Function

        Public Shared Function src(ByVal key As String) As Boolean
            Return strsame(key, "src", False)
        End Function

        Public Shared Function multiple(ByVal key As String) As Boolean
            Return strsame(key, "multiple", False)
        End Function

        Public Shared Function selected(ByVal key As String) As Boolean
            Return strsame(key, "selected", False)
        End Function

        Public Shared Function label(ByVal key As String) As Boolean
            Return strsame(key, "label", False)
        End Function

        Public Shared Function cols(ByVal key As String) As Boolean
            Return strsame(key, "cols", False)
        End Function

        Public Shared Function rows(ByVal key As String) As Boolean
            Return strsame(key, "rows", False)
        End Function

        Public Shared Function [for](ByVal key As String) As Boolean
            Return strsame(key, "for", False)
        End Function

        Public Shared Function border(ByVal key As String) As Boolean
            Return strsame(key, "border", False)
        End Function

        Public Shared Function cellpadding(ByVal key As String) As Boolean
            Return strsame(key, "cellpadding", False)
        End Function

        Public Shared Function cellspacing(ByVal key As String) As Boolean
            Return strsame(key, "cellspacing", False)
        End Function

        Public Shared Function frame(ByVal key As String) As Boolean
            Return strsame(key, "frame", False)
        End Function

        Public Shared Function rules(ByVal key As String) As Boolean
            Return strsame(key, "rules", False)
        End Function

        Public Shared Function summary(ByVal key As String) As Boolean
            Return strsame(key, "summary", False)
        End Function

        Public Shared Function abbr(ByVal key As String) As Boolean
            Return strsame(key, "abbr", False)
        End Function

        Public Shared Function align(ByVal key As String) As Boolean
            Return strsame(key, "align", False)
        End Function

        Public Shared Function axis(ByVal key As String) As Boolean
            Return strsame(key, "axis", False)
        End Function

        Public Shared Function [char](ByVal key As String) As Boolean
            Return strsame(key, "char", False)
        End Function

        Public Shared Function charoff(ByVal key As String) As Boolean
            Return strsame(key, "charoff", False)
        End Function

        Public Shared Function colspan(ByVal key As String) As Boolean
            Return strsame(key, "colspan", False)
        End Function

        Public Shared Function headers(ByVal key As String) As Boolean
            Return strsame(key, "headers", False)
        End Function

        Public Shared Function rowspan(ByVal key As String) As Boolean
            Return strsame(key, "rowspan", False)
        End Function

        Public Shared Function scope(ByVal key As String) As Boolean
            Return strsame(key, "scope", False)
        End Function

        Public Shared Function valign(ByVal key As String) As Boolean
            Return strsame(key, "valign", False)
        End Function

        Public Shared Function span(ByVal key As String) As Boolean
            Return strsame(key, "span", False)
        End Function

        Public Shared Function longdesc(ByVal key As String) As Boolean
            Return strsame(key, "longdesc", False)
        End Function

        Public Shared Function coords(ByVal key As String) As Boolean
            Return strsame(key, "coords", False)
        End Function

        Public Shared Function shape(ByVal key As String) As Boolean
            Return strsame(key, "shape", False)
        End Function

        Public Shared Function usemap(ByVal key As String) As Boolean
            Return strsame(key, "usemap", False)
        End Function

        Public Shared Function nohref(ByVal key As String) As Boolean
            Return strsame(key, "nohref", False)
        End Function

        Public Shared Function ismap(ByVal key As String) As Boolean
            Return strsame(key, "ismap", False)
        End Function

        Public Shared Function onblur(ByVal key As String) As Boolean
            Return strsame(key, "onblur", False)
        End Function

        Public Shared Function onfocus(ByVal key As String) As Boolean
            Return strsame(key, "onfocus", False)
        End Function

        Public Shared Function onload(ByVal key As String) As Boolean
            Return strsame(key, "onload", False)
        End Function

        Public Shared Function onunload(ByVal key As String) As Boolean
            Return strsame(key, "onunload", False)
        End Function

        Public Shared Function onreset(ByVal key As String) As Boolean
            Return strsame(key, "onreset", False)
        End Function

        Public Shared Function onsubmit(ByVal key As String) As Boolean
            Return strsame(key, "onsubmit", False)
        End Function

        Public Shared Function onchange(ByVal key As String) As Boolean
            Return strsame(key, "onchange", False)
        End Function

        Public Shared Function onpropertychange(ByVal key As String) As Boolean
            Return strsame(key, "onpropertychange", False)
        End Function

        Public Shared Function onselect(ByVal key As String) As Boolean
            Return strsame(key, "onselect", False)
        End Function

        Public Shared Function content(ByVal key As String) As Boolean
            Return strsame(key, "content", False)
        End Function

        Public Shared Function http_equiv(ByVal key As String) As Boolean
            Return strsame(key, "http-equiv", False)
        End Function

        Public Shared Function scheme(ByVal key As String) As Boolean
            Return strsame(key, "scheme", False)
        End Function

        Public Shared Function defer(ByVal key As String) As Boolean
            Return strsame(key, "defer", False)
        End Function

        Public Shared Function media(ByVal key As String) As Boolean
            Return strsame(key, "media", False)
        End Function

        Public Shared Function frameborder(ByVal key As String) As Boolean
            Return strsame(key, "frameborder", False)
        End Function

        Public Shared Function marginheight(ByVal key As String) As Boolean
            Return strsame(key, "marginheight", False)
        End Function

        Public Shared Function marginwidth(ByVal key As String) As Boolean
            Return strsame(key, "marginwidth", False)
        End Function

        Public Shared Function noresize(ByVal key As String) As Boolean
            Return strsame(key, "noresize", False)
        End Function

        Public Shared Function scrolling(ByVal key As String) As Boolean
            Return strsame(key, "scrolling", False)
        End Function

        Public Shared Function target(ByVal key As String) As Boolean
            Return strsame(key, "target", False)
        End Function

#If RETIRED Then
        Public Shared Function code(ByVal key As String) As Boolean
            Return strsame(key, "code", False)
        End Function

        Public Shared Function [object](ByVal key As String) As Boolean
            Return strsame(key, "object", False)
        End Function

        Public Shared Function color(ByVal key As String) As Boolean
            Return strsame(key, "color", False)
        End Function

        Public Shared Function face(ByVal key As String) As Boolean
            Return strsame(key, "face", False)
        End Function

        Public Shared Function prompt(ByVal key As String) As Boolean
            Return strsame(key, "prompt", False)
        End Function

        Public Shared Function compact(ByVal key As String) As Boolean
            Return strsame(key, "compact", False)
        End Function

        Public Shared Function alink(ByVal key As String) As Boolean
            Return strsame(key, "alink", False)
        End Function

        Public Shared Function background(ByVal key As String) As Boolean
            Return strsame(key, "background", False)
        End Function

        Public Shared Function bgcolor(ByVal key As String) As Boolean
            Return strsame(key, "bgcolor", False)
        End Function

        Public Shared Function link(ByVal key As String) As Boolean
            Return strsame(key, "link", False)
        End Function

        Public Shared Function text(ByVal key As String) As Boolean
            Return strsame(key, "text", False)
        End Function

        Public Shared Function vlink(ByVal key As String) As Boolean
            Return strsame(key, "vlink", False)
        End Function

        Public Shared Function clear(ByVal key As String) As Boolean
            Return strsame(key, "clear", False)
        End Function

        Public Shared Function noshade(ByVal key As String) As Boolean
            Return strsame(key, "noshade", False)
        End Function

        Public Shared Function hspace(ByVal key As String) As Boolean
            Return strsame(key, "hspace", False)
        End Function

        Public Shared Function vspace(ByVal key As String) As Boolean
            Return strsame(key, "vspace", False)
        End Function

        Public Shared Function start(ByVal key As String) As Boolean
            Return strsame(key, "start", False)
        End Function
#End If
    End Class
End Class
